package com.quzi.kettle.socket;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class UdpSend implements Runnable {

	byte[] b;

	public UdpSend(byte[] b) {
		this.b = b;
	}

	@Override
	public void run() {

		try {
			InetAddress address = InetAddress.getByName("255.255.255.255");

			DatagramSocket socket = new DatagramSocket(6444);

			DatagramPacket packet = new DatagramPacket(b, b.length, address,
					6444);

			socket.send(packet);

			socket.disconnect();
			socket.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	

	}

}
